#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
class Solution {
public:
    int fib(int n) {
        if (n == 0 || n == 1)
        {
            return n;
        }
        return n = fib(n - 2) + fib(n - 1);
    }
};

class Solution {
public:
    bool isPowerOfTwo(int n) {
        if (n < 1) return false;
        while (n != 1) {
            if (n % 2 == 1) return false;
            n = n / 2;
        }
        return true;
    }
};

class Solution {
public:
    bool isPowerOfTwo(int n) {
        return n > 0 && (n & (n - 1)) == 0;
    }
};
